<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet"
	href="${pageContext.request.contextPath }/css/style.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<div class="home-container" id="top">

		<div class="top-nav">
			<div class="mid-nav">
				<a href="${pageContext.request.contextPath}/index" class="header-title"><span>Back to Shopping</span></a>
			</div>
		</div>

		<div class="mid-nav">

			<table class="table table-striped"
				style="text-align: center; width: 850px;">
				<thead>
					<tr>
						<th>Image</th>
						<th>DishName</th>
						<th>Number</th>
						<th>Price</th>
					</tr>
				</thead>
				<tbody id="cartBody">
					<c:forEach var="cart" items="${cartList }">
						<tr id="${cart.did}">
							<td><img src="/image/${cart.dish.img}" class="dish-img"></td>
							<td>${cart.dish.name}</td>
							<td>${cart.count}</td>
							<td>${cart.dish.price * cart.count}</td>
						</tr>
						<c:set value="${sum + cart.dish.price * cart.count}" var="sum" />
					</c:forEach>
				</tbody>

				<tfoot>
					<tr>
						<td>Total:</td>
						<td id="total">${sum }</td>
						<td></td>
						<td><a
							href="${pageContext.request.contextPath}/client/order?action=pay"><button
									type="button" class="btn">Pay</button></a></td>
					</tr>
				</tfoot>
			</table>
		</div>
	</div>
</body>
</html>